package com.ruoyi.stream.framework.core;

import com.ruoyi.stream.framework.core.workDomain.SingleIOTaskGroup;
import com.ruoyi.stream.framework.core.workDomain.io.ConsumeIO;
import com.ruoyi.stream.framework.core.workDomain.io.IOBehavior;
import com.ruoyi.stream.framework.model.configBuilder.IOTaskConfig;
import io.netty.channel.Channel;

public abstract class IOTask<T extends IOTaskGroup<?> ,T2 extends IOTaskConfig<?>>{

    protected volatile IOBehavior cancel;

    protected volatile IOBehavior currentBehavior;

    protected volatile Channel channel;

    protected volatile T group;
    protected volatile IOBehavior read;

    protected volatile IOBehavior pause;

    protected volatile ConsumeIO write;

    public IOBehavior getCancel() {
        return cancel;
    }

    public IOBehavior getRead() {
        return read;
    }

    public IOBehavior getPause() {
        return pause;
    }

    public ConsumeIO getWrite() {
        return write;
    }

    public IOBehavior getCurrentBehavior() {
        return currentBehavior;
    }

    public Channel getChannel() {
        return channel;
    }



    protected IOTask() {
    }

    public abstract void config(T2 ioConfig);

    public abstract void setGroup(T ioTaskGroup);
}
